﻿package Message.Game
{
    import Framework.MQ.*;
    import Framework.Serialize.*;
    import Message.Public.*;

    public class SFightInfo extends IMessageBase
    {
        public var fromEntity:SEntityId;
        public var toEntity:SEntityId;
        public var attackType:EAttackType;
        public var fromEntityLevel:int;
        public var skillId:int;
        public var attack:int;
        public var crit:int;
        public var hit:int;
        public var penetration:int;
        public var expertise:int;
        public var crush:int;
        public var hitRate:int;
        public var attackId:int;
        public var mousePoint:SPoint;
        public var skillFightType:int;
        public const _type:int = 15951;
        public static var _regist:SFightInfo = new SFightInfo(true);

        public function SFightInfo(param1:Boolean = false)
        {
            if (param1)
            {
                MessageManager.instance().regist(this);
            }
            return;
        }// end function

        override public function getType() : int
        {
            return this._type;
        }// end function

        override public function clone() : IMessageBase
        {
            return new SFightInfo();
        }// end function

        override public function __write(param1:SerializeStream) : void
        {
            this.fromEntity.__write(param1);
            this.toEntity.__write(param1);
            this.attackType.__write(param1);
            param1.writeShort(this.fromEntityLevel);
            param1.writeInt(this.skillId);
            param1.writeInt(this.attack);
            param1.writeInt(this.crit);
            param1.writeInt(this.hit);
            param1.writeInt(this.penetration);
            param1.writeInt(this.expertise);
            param1.writeInt(this.crush);
            param1.writeInt(this.hitRate);
            param1.writeShort(this.attackId);
            this.mousePoint.__write(param1);
            param1.writeInt(this.skillFightType);
            return;
        }// end function

        override public function __read(param1:SerializeStream) : void
        {
            this.fromEntity = new SEntityId();
            this.fromEntity.__read(param1);
            this.toEntity = new SEntityId();
            this.toEntity.__read(param1);
            this.attackType = EAttackType.__read(param1);
            this.fromEntityLevel = param1.readShort();
            this.skillId = param1.readInt();
            this.attack = param1.readInt();
            this.crit = param1.readInt();
            this.hit = param1.readInt();
            this.penetration = param1.readInt();
            this.expertise = param1.readInt();
            this.crush = param1.readInt();
            this.hitRate = param1.readInt();
            this.attackId = param1.readShort();
            this.mousePoint = new SPoint();
            this.mousePoint.__read(param1);
            this.skillFightType = param1.readInt();
            return;
        }// end function

    }
}
